package com.woniuxy.house.mapper;

import com.woniuxy.house.entity.PictureChange;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 轮播图接口
 * @author baobo
 * @date 2022-08-28-14:41
 */
public interface PictureChangeMapper {
	/**
	 * 新增轮播图
	 * @param pictureChange
	 */
	@Insert("insert into house_picture_change(picture,number) values(#{picture},#{number})")
	void add(PictureChange pictureChange);

	/**
	 * 物理删除轮播图
	 * @param id
	 */
	@Delete("delete from house_picture_change where id=#{id}")
	void delete(Integer id);

	/**
	 * 升序排列获取指定数量的图片
	 * @param size
	 * @return
	 */
	@Select("select * from house_picture_change  order by number limit #{size}")
	List<PictureChange> getBySize(Integer size);
}
